package com.cac.demo.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program test-curd
 * @description 时间戳
 * @author: LSL
 * @create: 2022-08-09-14-26
 **/
public class DateUtil {
    /**
     * 时间戳
     * @return
     * @throws ParseException
     */
    public static Date nowTime() throws ParseException {
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String nowTime = sdf.format(date);
        Date time = sdf.parse(nowTime);
        return time;
    }
}
